﻿/*
 * @Date: 2025-06-13 11:11:55
 * @Auth: 463997479@qq.com
 * @FilePath: \corpus\config\routes.ts
 */
/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn， 注意去除风格后缀和大小写，如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward，如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
 * @doc https://umijs.org/docs/guides/routes
 */

export default [
  {
    path: '/user',
    layout: false,
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './User/Login',
      },
    ],
  },
  // {
  //   path: '/home',
  //   name: '首页',
  //   icon: 'home',
  //   component: '@/pages/Home/index.tsx',
  // },
  {
    path: '/message',
    name: '消息',
    hideInMenu: true,
    component: '@/pages/Message/index.tsx',
  },
  {
    path: '/catalogue',
    name: '资源目录',
    icon: 'folder',
    component: '@/pages/catalogue/list',
  },
  {
    path: '/catalogue/detail',
    name: '语料库资源目录-详情',
    hideInMenu: true,
    component: '@/pages/catalogue/detail',
  },
  {
    path: '/resourceManagement',
    name: '数据资源管理',
    icon: 'folderOpen',
    component: '@/pages/resourceManagement/list',
  },
  {
    path: '/resourceManagement/corpus-file',
    name: '语料库资源管理-文件列表',
    hideInMenu: true,

    component: '@/pages/resourceManagement/list/component/CorpusFile',
  },
  {
    path: '/resourceManagement/knowledge-content',
    name: '知识库内容',

    hideInMenu: true,
    component: '@/pages/resourceManagement/list/component/KnowledgeDawer',
  },
  {
    path: '/resourceManagement/fileList',
    name: '原始数据管理',
    hideInMenu: true,
    component: '@/pages/resourceManagement/fileList',
  },
  {
    path: '/common-home',
    name: '公共知识库',
    icon: 'global',
    component: '@/pages/Home/HomeCommon.tsx',
    // access: 'admin',
  },

  {
    path: '/dept-home/list',
    name: '部门知识库',
    icon: 'apartment',
    component: '@/pages/Home/DeptHome.tsx',
  },
  {
    path: '/person-home',
    name: '个人知识库',
    icon: 'user',
    component: '@/pages/Home/PersonHome.tsx',
    // access: 'admin',
  },
  // {
  //   path: '/dept-home',
  //   name: '部门知识库',
  //   icon: 'team',
  //   routes: [
  //     {
  //       path: '/dept-home/list',
  //       name: '部门知识库',
  //       icon: 'apartment',
  //       component: '@/pages/Home/DeptHome.tsx',
  //     },
  //     {
  //       path: '/dept-home/deptPermision',
  //       name: '知识库权限管理',
  //       icon: 'apartment',
  //       access: 'canDept',
  //       component: '@/pages/Home/DeptPermision',
  //     },
  //   ],
  // },
  // {
  //   path: '/scene-home',
  //   name: '场景知识库',
  //   icon: 'appstore',

  //   component: '@/pages/Home/HomeScene.tsx',
  //   // access: 'admin',
  // },
  // {
  //   path: '/common-home',
  //   name: '公共知识库',
  //   icon: 'global',

  //   component: '@/pages/Home/HomeCommon.tsx',
  //   // access: 'admin',
  // },
  {
    path: '/knowledge-apply',
    name: '知识库上传申请',
    icon: 'global',
    hideInMenu: true,
    parentKeys: ['/home'],

    component: '@/pages/AuthKnowledge/index.tsx',
    // access: 'admin',
  },
  // {
  //   path: '/system',
  //   name: '系统管理',
  //   icon: 'apartment',
  //   routes: [
  //     {
  //       path: '/system/system',
  //       name: '角色管理',
  //       icon: 'apartment',
  //       component: '@/pages/User/Manage/index.tsx',
  //     },

  //     {
  //       path: '/system/system1',
  //       name: '权限管理',
  //       icon: 'apartment',
  //       component: '@/pages/User/Manage/index1.tsx',
  //     },
  //   ],
  // },
  {
    path: '/foundation-home',
    name: '基础语料库',
    icon: 'apartment',
    access: 'canAdmin',
    routes: [
      // {
      //   path: '/foundation-home/government',
      //   name: '政务基础语料库',
      //   icon: 'apartment',
      //   component: '@/pages/Foundation/government.tsx',
      // },

      // {
      //   path: '/foundation-home/city',
      //   name: '城市治理基础语料库',

      //   icon: 'apartment',
      //   component: '@/pages/Foundation/city.tsx',
      // },
      {
        path: '/foundation-home/file',
        name: '政务基础语料库',
        icon: 'apartment',

        component: '@/pages/Foundation/Manage',
      },

      {
        path: '/foundation-home/manage-government',
        name: '语料库管理文档',
        parentKeys: ['/foundation-home/government'],

        icon: 'apartment',
        component: '@/pages/Foundation/Manage',
        hideInMenu: true,
      },

      {
        path: '/foundation-home/city-corpus',
        name: '城市治理基础语料库',

        icon: 'apartment',
        component: '@/pages/governanceCorpus/list',
      },
      {
        path: '/foundation-home/fileList',
        name: '资源管理-文件列表',
        parentKeys: ['/foundation-home/city-corpus'],

        hideInMenu: true,
        component: '@/pages/governanceCorpus/fileList',
      },
      {
        path: '/foundation-home/corpus-file',
        name: '语料库资源管理-文件列表',
        parentKeys: ['/foundation-home/city-corpus'],

        hideInMenu: true,
        component: '@/pages/governanceCorpus/list/component/CorpusFile',
      },
    ],
  },

  {
    path: '/person-home/file',
    name: '文档列表',
    parentKeys: ['/person-home'],
    hideInMenu: true,
    component: '@/pages/corpusFile/index',
  },
  {
    path: '/knowledge/file1',
    name: '文档列表',
    hideInMenu: true,

    parentKeys: ['/common-home'],

    component: '@/pages/corpusFile/index',
  },
  {
    path: '/knowledge/file2',
    name: '文档列表',
    hideInMenu: true,

    parentKeys: ['/scene-home'],

    component: '@/pages/corpusFile/index',
  },
  {
    path: '/knowledge/file3',
    name: '文档列表',
    parentKeys: ['/dept-home'],
    hideInMenu: true,

    component: '@/pages/corpusFile/index',
  },
  {
    path: '/knowledge/file5',
    name: '文档列表',
    parentKeys: ['/foundation-home/city'],

    component: '@/pages/corpusFile/index',
    hideInMenu: true,
  },
  {
    path: '/',
    redirect: '/catalogue',
  },
  {
    path: '*',
    layout: false,
    component: './404',
  },
  {
    path: '/systemManagement',
    name: '系统管理',
    icon: 'apartment',
    routes: [
      // {
      //   path: '/systemManagement/user',
      //   component: '@/pages/systemManagement/user',
      //   name: '用户管理',
      // },
      {
        path: '/systemManagement/menu',
        component: '@/pages/systemManagement/menu',
        name: '菜单管理',
      },
      {
        path: '/systemManagement/role',
        component: '@/pages/systemManagement/role',
        name: '角色管理',
      },
    ],
  },
];
